<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>在线咨询 - 外卖APP</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css">
    <style>
        :root {
            --primary-color: #2563eb;
            --secondary-color: #3b82f6;
            --accent-color: #f59e0b;
            --text-primary: #1f2937;
            --text-secondary: #4b5563;
            --background-light: #f8fafc;
            --success-color: #10b981;
            --warning-color: #f59e0b;
            --danger-color: #ef4444;
        }

        body {
            margin: 0;
            padding: 0;
            background: #f5f5f5;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        }

        .phone-container {
            width: 390px;
            height: 844px;
            margin: 20px auto;
            background: var(--background-light);
            position: relative;
            overflow: hidden;
            box-shadow: 0 0 20px rgba(0,0,0,0.1);
            border-radius: 40px;
        }

        .header {
            padding: 15px;
            background: white;
            position: sticky;
            top: 0;
            z-index: 100;
            display: flex;
            align-items: center;
            gap: 15px;
            border-bottom: 1px solid rgba(0,0,0,0.05);
        }

        .back-button {
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-primary);
            text-decoration: none;
        }

        .header-title {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
            flex: 1;
        }

        .merchant-info {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .merchant-avatar {
            width: 32px;
            height: 32px;
            border-radius: 16px;
            object-fit: cover;
        }

        .chat-container {
            height: calc(100% - 130px);
            overflow-y: auto;
            padding: 15px;
            background: var(--background-light);
        }

        .chat-container::-webkit-scrollbar {
            width: 0;
        }

        .message {
            display: flex;
            margin-bottom: 20px;
            align-items: flex-start;
        }

        .message.received {
            flex-direction: row;
        }

        .message.sent {
            flex-direction: row-reverse;
        }

        .avatar {
            width: 40px;
            height: 40px;
            border-radius: 20px;
            margin: 0 10px;
        }

        .message-content {
            max-width: 70%;
        }

        .message-bubble {
            padding: 12px 16px;
            border-radius: 16px;
            font-size: 14px;
            line-height: 1.5;
            position: relative;
        }

        .message.received .message-bubble {
            background: white;
            color: var(--text-primary);
            border-top-left-radius: 4px;
        }

        .message.sent .message-bubble {
            background: var(--primary-color);
            color: white;
            border-top-right-radius: 4px;
        }

        .message-time {
            font-size: 12px;
            color: var(--text-secondary);
            margin-top: 4px;
            text-align: center;
        }

        .system-message {
            text-align: center;
            margin: 20px 0;
            font-size: 12px;
            color: var(--text-secondary);
        }

        .quick-replies {
            display: flex;
            gap: 8px;
            margin-top: 8px;
            flex-wrap: wrap;
        }

        .quick-reply {
            padding: 6px 12px;
            border-radius: 16px;
            background: white;
            color: var(--primary-color);
            font-size: 12px;
            border: 1px solid var(--primary-color);
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .quick-reply:hover {
            background: var(--primary-color);
            color: white;
        }

        .input-container {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            padding: 15px;
            background: white;
            border-top: 1px solid #f3f4f6;
        }

        .input-wrapper {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .chat-input {
            flex: 1;
            padding: 12px;
            border: 1px solid #e5e7eb;
            border-radius: 24px;
            font-size: 14px;
            outline: none;
            transition: all 0.2s ease;
        }

        .chat-input:focus {
            border-color: var(--primary-color);
        }

        .send-button {
            width: 40px;
            height: 40px;
            border-radius: 20px;
            background: var(--primary-color);
            color: white;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .send-button:hover {
            opacity: 0.9;
        }

        .send-button i {
            font-size: 18px;
        }
    </style>
</head>
<body>
    <div class="phone-container">
        <div class="header">
            <a href="contact-merchant.html" class="back-button">
                <i class="bi bi-chevron-left"></i>
            </a>
            <div class="merchant-info">
                <img src="https://images.unsplash.com/photo-1552566626-52f8b828add9?w=100" alt="商家头像" class="merchant-avatar">
                <div class="header-title">川味小馆</div>
            </div>
        </div>

        <div class="chat-container">
            <div class="system-message">
                2024年1月20日 14:30
            </div>

            <div class="message received">
                <img src="https://images.unsplash.com/photo-1552566626-52f8b828add9?w=100" alt="商家头像" class="avatar">
                <div class="message-content">
                    <div class="message-bubble">
                        您好，请问有什么可以帮您？
                    </div>
                    <div class="quick-replies">
                        <div class="quick-reply">订单修改</div>
                        <div class="quick-reply">配送时间</div>
                        <div class="quick-reply">退款问题</div>
                        <div class="quick-reply">催单</div>
                    </div>
                </div>
            </div>

            <div class="message sent">
                <img src="https://images.unsplash.com/photo-1633332755192-727a05c4013d?w=100" alt="用户头像" class="avatar">
                <div class="message-content">
                    <div class="message-bubble">
                        您好，我想问一下我的订单大概什么时候能送到？
                    </div>
                </div>
            </div>

            <div class="message received">
                <img src="https://images.unsplash.com/photo-1552566626-52f8b828add9?w=100" alt="商家头像" class="avatar">
                <div class="message-content">
                    <div class="message-bubble">
                        您好，我看到您的订单已经在配送中了，骑手预计15分钟内送达，请您耐心等待。
                    </div>
                </div>
            </div>

            <div class="message sent">
                <img src="https://images.unsplash.com/photo-1633332755192-727a05c4013d?w=100" alt="用户头像" class="avatar">
                <div class="message-content">
                    <div class="message-bubble">
                        好的，谢谢！
                    </div>
                </div>
            </div>
        </div>

        <div class="input-container">
            <div class="input-wrapper">
                <input type="text" class="chat-input" placeholder="请输入消息...">
                <button class="send-button">
                    <i class="bi bi-send"></i>
                </button>
            </div>
        </div>
    </div>

    <script>
        // 快速回复点击效果
        document.querySelectorAll('.quick-reply').forEach(reply => {
            reply.addEventListener('click', function() {
                const input = document.querySelector('.chat-input');
                input.value = this.textContent;
                input.focus();
            });
        });

        // 发送消息功能
        const sendMessage = () => {
            const input = document.querySelector('.chat-input');
            const message = input.value.trim();
            
            if (message) {
                const chatContainer = document.querySelector('.chat-container');
                const messageHTML = `
                    <div class="message sent">
                        <img src="https://images.unsplash.com/photo-1633332755192-727a05c4013d?w=100" alt="用户头像" class="avatar">
                        <div class="message-content">
                            <div class="message-bubble">
                                ${message}
                            </div>
                        </div>
                    </div>
                `;
                
                chatContainer.insertAdjacentHTML('beforeend', messageHTML);
                input.value = '';
                chatContainer.scrollTop = chatContainer.scrollHeight;
            }
        };

        // 绑定发送按钮点击事件
        document.querySelector('.send-button').addEventListener('click', sendMessage);

        // 绑定回车键发送
        document.querySelector('.chat-input').addEventListener('keypress', function(e) {
            if (e.key === 'Enter') {
                sendMessage();
            }
        });
    </script>
</body>
</html> 